Hello again Dxlers, I have a dxl script that generates views and looks for missing links. Just before finishing I ran a test that did not work with requirements with external links. How is the filter set up to detect external links? best regards Colm MyDeveloerWorks - Tue Mar 11 17:48:50 EDT 2014 |
Re: Filters and External links Don't recall if you can do it directly. But you can certainly:
-Louie |
Re: Filters and External links llandale - Wed Mar 12 11:15:37 EDT 2014 Don't recall if you can do it directly. But you can certainly:
-Louie Hello Louie,.
I tried going the iteration as follows, but all my attributes stayed at false, despite some having external links
bool Has= false
Object o = current
ExternalLink el
//Iterate over outward links
for el in o->"" do
{
Has = true
}
o.attrDXLName = Has
|
Re: Filters and External links MyDeveloerWorks - Thu Mar 13 06:13:55 EDT 2014 Hello Louie,.
I tried going the iteration as follows, but all my attributes stayed at false, despite some having external links
bool Has= false
Object o = current
ExternalLink el
//Iterate over outward links
for el in o->"" do
{
Has = true
}
o.attrDXLName = Has
Well the DXL Help says:
for all outgoing external links
That works for me... /sekrbo |
Re: Filters and External links MyDeveloerWorks - Thu Mar 13 06:13:55 EDT 2014 Hello Louie,.
I tried going the iteration as follows, but all my attributes stayed at false, despite some having external links
bool Has= false
Object o = current
ExternalLink el
//Iterate over outward links
for el in o->"" do
{
Has = true
}
o.attrDXLName = Has
In the end I got this to work. I also forgot to execute the menu item "refresh dxl Attributes"
bool Has= false
Object o = current
ExternalLink el
//Iterate over outward links
for el in o->"" do
{
Has = true
}
for el in o<-"" do
{
Has = true
}
o.attrDXLName = Has
|
Re: Filters and External links sekrbo - Thu Mar 13 08:16:28 EDT 2014 Well the DXL Help says:
for all outgoing external links
That works for me... /sekrbo Thanks for the contribution Sekrbo. That code was useful for testing in the dxl editor.
|
Re: Filters and External links MyDeveloerWorks - Thu Mar 13 10:07:21 EDT 2014 In the end I got this to work. I also forgot to execute the menu item "refresh dxl Attributes"
bool Has= false
Object o = current
ExternalLink el
//Iterate over outward links
for el in o->"" do
{
Has = true
}
for el in o<-"" do
{
Has = true
}
o.attrDXLName = Has
Well since it's a DXL attribute you're working on you can skip the Object o = current, as the variable obj is already defined as the current object... thus giving you:
/sekrbo |
Re: Filters and External links sekrbo - Thu Mar 13 10:37:55 EDT 2014 Well since it's a DXL attribute you're working on you can skip the Object o = current, as the variable obj is already defined as the current object... thus giving you:
/sekrbo In fact, Object o = current is incorrect, not just "can be skipped". I point out that the attribute needs to be defined as Boolean. -Louie |
Re: Filters and External links sekrbo - Thu Mar 13 10:37:55 EDT 2014 Well since it's a DXL attribute you're working on you can skip the Object o = current, as the variable obj is already defined as the current object... thus giving you:
/sekrbo A minor point, perhaps, but there's an optimization possible here, certainly if objects can have multiple links:
bool Has= false
ExternalLink el
//Iterate over outward links
for el in obj->"" do
{
Has = true
break // Stop looking, we've found one...
}
if (!Has) { // Don't bother if we already found an outgoing link
for el in obj<-"" do
{
Has = true
break // Stop looking, we've found one...
}
}
obj.attrDXLName = Has
Just one thing (cannot check it now): should the obj->"" and obj<-"" include the asterisk, i.e. obj->"*" and obj<-"*"?
Regards, Marcel |